package com.lc.pianostudent.activity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.lc.pianostudent.R;
import com.zcx.helper.bound.BoundView;

/**
 * Created by Administrator on 2018/6/25.
 */

public class HelpActivity extends BaseActivity{

    @BoundView(R.id.webview1)
    private WebView webView;

    private String url, title;//标题，链接
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_heip);
        url = getIntent().getStringExtra("url");
        title = getIntent().getStringExtra("title");
        setBackTrue();
        setTitleName(title);

        WebSettings webSettings = webView.getSettings();
        webSettings.setAllowFileAccess(true);
        webSettings.setDomStorageEnabled(true);//允许DCOM
        webSettings.setJavaScriptEnabled(true);
        webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
        webSettings.setTextSize(WebSettings.TextSize.NORMAL);
        webView.loadUrl(url);
        webView.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return false;
            }
        });

    }
}
